package com.tamecode.web;

import com.tamecode.utils.ClassLocationUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.net.URL;

/**
 * @Author: Liqc
 * @Date: 2022/6/1 23:46
 */
@Controller
public class SrcDirController {

    @RequestMapping(value = "srcAdd")
    public String srcAdd(HttpServletRequest request, String clazz) {
        request.getSession().setAttribute("className", clazz);
        return "srcAdd";
    }

    @ResponseBody
    @RequestMapping(value = "src/util")
    public String srcUtil(HttpServletRequest request, String clazz) {
        String where = ClassLocationUtils.where(URL.class);
        System.out.println(where);
        return where;
    }
}
